package com.nbsaas.boot.job.rest.convert;

import com.nbsaas.boot.job.data.entity.Job;
import com.nbsaas.boot.job.api.domain.response.JobResponse;

import com.nbsaas.boot.utils.BeanDataUtils;
import com.nbsaas.boot.rest.api.Converter;
/**
* 职位-实体对象转化成响应对象
*/

public class JobResponseConvert  implements Converter<JobResponse,Job> {

    @Override
    public JobResponse convert(Job source) {
        JobResponse  result = new  JobResponse();
        BeanDataUtils.copyProperties(source, result);
                    if(source.getCreator()!=null){
                        result.setCreator(source.getCreator().getId());
                    }
        return result;
    }

}

